<div class="content-section implementation GridDemo" id="myContent" >
    <div class="title col-sm-12">
        <div class="col-sm-1">
            <span>{{formTitle}}</span>
        </div>
        <div class="col-sm-11 pull-right">
            <button type="button"
                    class="pull-right"
                    pButton
                    (click)="goBack()"
                    icon="fa-close"
                    style="width: 30px"></button>
        </div>
    </div>
    <form [formGroup]="myForm" class="form-horizontal">
        <div class="form-group switch-style">
            <div class="col-sm-12 ui-no-padding-left-15px ui-padding-10px">
                <button class="ui-margin-right-10px" pButton type="button" (click)="switch('0')" label="基本信息" ></button>
                <button  class="ui-margin-right-10px" pButton type="button" (click)="switch('1')" label="关联工单" ></button>
                <button pButton type="button"  label="履历" (click)="switch('2')"></button>
            </div>
        </div>
        <div [ngSwitch]="switchValue">
            <div *ngSwitchCase="0" >
                <div class="form-group">
                    <label class="col-sm-2 control-label">编号：</label>
                    <div class="col-sm-4 ui-fluid-no-padding">
                        <input type="text" pInputText
                               class="form-control cursor_not_allowed"
                               placeholder="自动生成"
                               readonly
                               [value]="formObj.kid"
                        />
                    </div>
                    <label class="col-sm-2 control-label">创建人：</label>
                    <div class="col-sm-4 ui-fluid-no-padding">
                        <input type="text"
                               class=" form-control cursor_not_allowed"
                               pInputText
                               placeholder="自动生成"
                               [value]="formObj.create_name"
                               readonly />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <span ngClass="start_red">*</span>知识分类：</label>
                    <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                        <p-dropdown [options]="allknowledgeClasssify"
                                    [(ngModel)]="formObj.knowledge_classify"
                                    [ngModelOptions]="{standalone: true}"
                                    (onClick)="knowledgeClasssifySelected()"
                                    placeholder="{{formObj.knowledge_classify}}"
                                    [style]="{'width':'100%'}"
                        ></p-dropdown>
                    </div>
                    <label class="col-sm-2 control-label">创建时间：</label>
                    <div class="col-sm-4 ui-fluid-no-padding">
                        <input type="text"
                               class=" form-control cursor_not_allowed"
                               pInputText
                               placeholder="以提交或者保存知识工单时间为准"
                               [value]="formObj.create_time"
                               readonly />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">子分类：</label>
                    <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                        <p-dropdown [options]="allClassify"
                                    [(ngModel)]="formObj.classify"
                                    (onClick)="classsifySelected()"
                                    [ngModelOptions]="{standalone: true}"
                                    placeholder="{{formObj.classify}}"
                                    [style]="{'width':'100%'}"
                        ></p-dropdown>
                    </div>
                    <label class="col-sm-2 control-label">
                        <span ngClass="start_red">*</span>
                        技术审批人：
                    </label>
                    <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                        <p-dropdown [options]="allApprovals"
                                    [(ngModel)]="formObj.approver_name"
                                    placeholder="{{formObj.approver_name}}"
                                    formControlName="approver_name"
                                    [style]="{'width':'100%'}"
                        ></p-dropdown>
                        <app-field-error-display [displayError]="isFieldValid('approver_name')" errorMsg="不能为空"></app-field-error-display>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">子目录：</label>
                    <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                        <p-dropdown [options]="allCatalog"
                                    [(ngModel)]="formObj.catalog"
                                    (onClick)="catalogSelected()"
                                    [ngModelOptions]="{standalone: true}"
                                    placeholder="{{formObj.catalog}}"
                                    [style]="{'width':'100%'}"
                        ></p-dropdown>
                    </div>
                    <label class="col-sm-2 control-label">知识管理员：</label>
                    <div class="col-sm-4 ui-fluid-no-padding ui-fluid">
                        <p-dropdown [options]="allManages"
                                    [(ngModel)]="formObj.manager_name"
                                    placeholder="{{formObj.manager_name}}"
                                    [ngModelOptions]="{standalone: true}"
                                    [style]="{'width':'100%'}"
                        ></p-dropdown>
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-2 control-label">
                        <span ngClass="start_red">*</span>
                        标签：</label>
                    <div class="col-sm-10 ui-no-padding-left-15px ui-fluid">
                        <input type="text" pInputText
                               formControlName="label"
                               [(ngModel)]="formObj.label"/>
                        <app-field-error-display [displayError]="isFieldValid('label')" errorMsg="不能为空"></app-field-error-display>
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-2 control-label">
                        <span ngClass="start_red">*</span>
                        标题：</label>
                    <div class="col-sm-10 ui-no-padding-left-15px ui-fluid">
                        <input type="text" pInputText
                               formControlName="title"
                               [(ngModel)]="formObj.title"/>
                        <app-field-error-display [displayError]="isFieldValid('title')" errorMsg="不能为空"></app-field-error-display>

                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-2 control-label">
                        <span ngClass="start_red">*</span>
                        知识详述：</label>
                    <div class="col-sm-10 ui-no-padding-left-15px ui-fluid">
                        <app-editor [uploadImageUrl]="uploadImageUrl"></app-editor>
                    </div>
                    <!--<img src="http://127.0.0.1/data/file/knowledge/upload/attachments/微信图片_20171222092005 - 副本 (2)_1522393694.jpg">-->
                </div>
                <div class="form-group ">
                    <label class="col-sm-2 control-label">
                        附件：
                    </label>
                    <div class="col-sm-9 ui-fluid-no-padding ">
                        <p-fileUpload name="file" url="{{ip}}/knowledge/upload"
                                      multiple="multiple"
                                      accept="image/*,application/*,text/*"
                                      chooseLabel="选择"
                                      uploadLabel="上传"
                                      cancelLabel="取消"
                                      maxFileSize="3145728"
                                      (onUpload)="onUpload($event)"
                                      (onBeforeUpload)="onBeforeUpload($event)"
                                      #form>
                            <ng-template pTemplate="content">
                                <ul *ngIf="uploadedFiles?.length">
                                    <li *ngFor="let file of uploadedFiles">{{file.name}} - {{file.size}} bytes</li>
                                </ul>
                            </ng-template>
                        </p-fileUpload>
                    </div>
                </div>
                <div class="form-group ">
                    <div class="col-sm-12 ui-no-padding-left-15px ">
                        <button class="pull-right  ui-button-secondary" pButton type="button"  label="取消" (click)="goBack()"></button>
                        <button  class="pull-right ui-margin-right-10px" pButton type="button" (click)="save()" label="保存" ></button>
                        <button class="pull-right ui-margin-right-10px" pButton type="button" (click)="submit()" label="提交" ></button>
                    </div>
                </div>
            </div>
            <div *ngSwitchCase="1">
                <div class="form-group switch-style">
                    <div class="col-sm-12 ui-no-padding-left-15px ui-padding-10px">
                        <button class="pull-right ui-margin-right-10px" pButton type="button" (click)="deleteOrder()" label="删除" ></button>
                        <button  class="pull-right ui-margin-right-10px" pButton type="button" (click)="openEquipList()" label="关联工单" ></button>
                    </div>
                </div>
                <div class="form-group switch-style">
                    <div class="col-sm-12 ui-no-padding-left-15px ui-padding-10px">
                        <app-klg-associate-order-table [scheduleDatas]="selectedWorkOrders"></app-klg-associate-order-table>
                    </div>
                </div>
            </div>
            <div *ngSwitchCase="2">
                <div class="form-group switch-style">
                    <div class="col-sm-12 ui-no-padding-left-15px ui-padding-10px">
                        <app-klg-curriculum-table></app-klg-curriculum-table>
                    </div>
                </div>
            </div>
        </div>
        <app-select-associate-order #selectAssociateOrderComponent  [display]="controlDiaglog" (displayEmitter)="dcontrolDialogHandler()" (selectedWorkOrders)="getSelectedWorkOrders($event)"></app-select-associate-order>
    </form>














    <!--<p-dialog header="请选择" [(visible)]="display" modal="modal" width="width" [responsive]="true" minHeight="500">-->
    <!--<p-tree [value]="filesTree4"-->
    <!--selectionMode="single"-->
    <!--[(selection)]="selected"-->
    <!--(onNodeExpand)="nodeExpand($event)"-->
    <!--&gt;</p-tree>-->
    <!--&lt;!&ndash;<div style="margin-top:8px">Selected Node: {{selected ? selected.label : 'none'}}</div>&ndash;&gt;-->
    <!--<p-footer>-->
    <!--<button type="button" pButton icon="fa-check" (click)="closeTreeDialog()" label="确定"></button>-->
    <!--<button type="button" pButton icon="fa-close" (click)="display=false"-->
    <!--class="ui-button-secondary" label="取消"></button>-->
    <!--</p-footer>-->
    <!--</p-dialog>-->
    <p-growl [(value)]="message"></p-growl>
</div>
